﻿Public Class Principal

    Private Sub Principal_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        LoginForm1.Close()
    End Sub

    Private Sub Principal_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        ToolStripStatusLabel2.Text = LoginForm1.USUARIOTextBox.Text
        If LoginForm1.GRUPOComboBox.Text = "MASTER" Then
            USUÁRIOSToolStripMenuItem.Enabled = True
        Else
            USUÁRIOSToolStripMenuItem.Enabled = False
        End If
    End Sub

    Private Sub SAIRToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SAIRToolStripMenuItem.Click
        If MsgBox("DESEJA REALMENTE SAIR", MsgBoxStyle.YesNo, "ATENÇÃO") = MsgBoxResult.Yes Then
            Me.Close()
        End If
    End Sub

    Private Sub USUÁRIOSToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles USUÁRIOSToolStripMenuItem.Click
        USUARIO.MdiParent = Me
        USUARIO.Show()
    End Sub

    Private Sub CADASTROToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CADASTROToolStripMenuItem.Click
        CADASTRO.MdiParent = Me
        CADASTRO.Show()
    End Sub

    Private Sub RELATORIOToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RELATORIOToolStripMenuItem.Click
        RELATORIO.MdiParent = Me
        RELATORIO.Show()
    End Sub
End Class
